<? 
	if(isset($_POST['btngo']))
	{
		require("required/dbconnect.php");
		$main_cat=$_POST['main_cat'];
		$pageno=$_POST['pageno'];
		header("Location:uploadfiles.php?page=$pageno");
	}
	
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";



	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
	
	
	$get_files=mysql_query("select * from os_uploadfiles where type='collection' order by filename asc")or die(mysql_error());
	
	
	

	
	
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	<td valign="top">
	
			<font class="title">Collection Files</font>
			
		
			<table width="100%" class="solidborder">
				<tr class="table_header">
					<td width="2%">No</td><td width="25%">Description</td>
				  <td width="29%">File name</td><td width="16%">File Size</td><td width="12%">Type</td>
				  <td width="16%">Action</td>
			  </tr>
				<? if(mysql_num_rows($get_files)==0){ ?>
				<tr valign="top">
					<td align="center" colspan="7">
					- No record found - 
					</td>
				
				<? 
					}
					else
					{
						$no=1;
						while($a=mysql_fetch_array($get_files,MYSQL_ASSOC))
						{
							$id=$a['id'];
							if($no%2==0)
							{
								$class1="table_item_even";
								$class2="table_item_odd";
							}
							else
							{
								$class1="table_item_odd";
								$class2="table_item_even";
							}				
							
				?>
			   <tr height="20" valign="top" class="<?= $class1 ?>" onmouseover="this.className='table_item_mouseover'" 
                            onmouseout="this.className='<?= $class1 ?>'">
						<td align="center"><?= $no ?></td>
                        <td><?= $a['description'] ?></td>
						<td><?= $a['filename'] ?></td>
						<td align="center">
						<?= number_format($a['file_size']/1024,0) ?> KB
						</td>
                        <td align="center">
						<?= $a['file_extention'] ?>
						</td>
						
						<td align="center"><a href="../uploadfiles/<?= $a['filename'] ?>"><img src="images/icons/download.gif" border="0" alt="Download"></a> 
                        <a href="collection_file_delete.php?id=<?= $id ?>"> <img src="images/icons/delete.gif" border="0"></a></td>								
			  </tr>
				<? 
					$no++; 
						}
					}
				?>
				
			</table>
			<script type="text/javascript" src="required/js/calendarDateInput.js"></script>		
			
			<script language="javascript">
				function frmValidate(frm)
				{
					if(document.frm.filename.value=="")
					{
						alert("Please enter file name");
						document.frm.filename.focus();
						return false;
					}
					return true;
				}
			</script>
		<table>
			<tr>
				<td colspan="3"><strong>Upload New Files</strong></td>
			</tr>
			<form method="post" name="frm" enctype="multipart/form-data" action="collection_file_upload2.php" onSubmit="return frmValidate(this)">
			<tr> 
					<td valign=top align="left"> 
					<font size=+1>Notice:</font>
					<ul>
						<li>The file size must less than 5MB</li>
					</ul>
					</td>
				</tr>
			<tr>
				<td>
				<input type="hidden" name="MAX_FILE_SIZE" value="5000000"> 
				  <input type="file" name="file" class=button><br>
				  <br>
				  
				  Description : <input type="text" size="10" maxlength="50" value="" name="description" class="text"> 
				  <input type="submit" value="upload" name=submit class=button> 
                   <input type="button" value="Back" onclick="window.open('photo_album_view.php?id=10','_self')" class=button> 
				</td>
			</tr>
			</form>
			
		</table>

		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

